package com.bw.zonghe0719.room

import android.provider.ContactsContract.CommonDataKinds.Phone
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface HistoryDao {
    //新增
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addHistory(historyEntity: HistoryEntity)
    //查询
    @Query("select * from history where phone=:phone")
    fun queryHistory(phone:String):MutableList<HistoryEntity>
    //单个删除
    @Delete
    fun delHistory(historyEntity: HistoryEntity)
    //批量删除
    @Query("delete from history")
    fun delAllHistory()
}